package com.woniuxy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * TODO
 *
 * @Description
 * @Author jresm骏
 * @Date 2022/12/5 20:53
 **/
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients //开启OpenFeign
@EnableHystrix //开启Hystrix自动配置
public class OrderApp {

    public static void main(String[] args) {
        SpringApplication.run(OrderApp.class,args);
    }

    @Bean
    @LoadBalanced //用的就是ribbon中的负载均衡策略：默认用的轮询
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
